package carddemo;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 12629
 * @Description：
 */
public class Test {

    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>> ret = new ArrayList<>();

        List<Integer> list = new ArrayList<>();
        list.add(1);

        ret.add(list);

        for (int i = 1; i < numRows; i++) {
            List<Integer> curRow = new ArrayList<>();
            curRow.add(1);
            //上一行
            List<Integer> prevRow = ret.get(i-1);
            for (int j = 1; j < i; j++) {
                int num = prevRow.get(j)+prevRow.get(j-1);
                curRow.add(num);
            }
            curRow.add(1);
            ret.add(curRow);
        }
        return ret;
    }



    public static void main1(String[] args) {
        CardDemo cardDemo = new CardDemo();
        List<Card> ret = cardDemo.buyDeskCard();
        System.out.println(ret);
        System.out.println("洗牌：");
        cardDemo.shuffle(ret);
        System.out.println(ret);
        System.out.println("揭牌：");
        List<List<Card>> ret2 = cardDemo.test(ret);
        /*for (List<Card> cards : ret2) {
            System.out.println(cards);
        }*/
        for (int i = 0; i < ret2.size(); i++) {
            System.out.println("第"+i+"个人的牌："+ret2.get(i));
        }
        System.out.println("剩余的牌：");
        System.out.println(ret);
    }
}
